#pragma once
#include "Data.h"
#include "TArray.h"


struct DataPack
{
public:
	DataPack();
	~DataPack();

	u8_t* MemDataPtr( s32_t index);

	template < typename T>
	T& GetData( s32_t index);
	
	void Clear();
	void _loading_InitMem();

	/*
	return item index 
	*/
	s32_t DefItem( EDataType type);

	struct DataItem
	{
		unsigned short	Type;
		unsigned short	Pos;
	};

	TArray< DataItem> mItems;
	TArray< u8_t> mDataBuf;

};

template < typename T>
T& DataPack::GetData( s32_t index)
{
	return *(T*)MemDataPtr( index);
}